<template>
  <div class="not-found-page">
    <n-result status="404" title="404 页面未找到" description="抱歉，您访问的页面不存在">
      <template #footer>
        <n-space justify="center">
          <n-button @click="goHome" type="primary">
            返回首页
          </n-button>
          <n-button @click="goBack">
            返回上一页
          </n-button>
        </n-space>
      </template>
    </n-result>
  </div>
</template>

<script setup lang="ts">
import { useRouter } from 'vue-router'

const router = useRouter()

const goHome = () => {
  router.push({ name: 'home' })
}

const goBack = () => {
  router.go(-1)
}
</script>

<style scoped>
.not-found-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  padding: 40px;
}
</style>
